package com.mspbots.web.core;

import com.mspbots.web.core.service.TimeLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * com.mspbots.web.core.TimeLogController
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/7/2
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(path = "time-log")
public class TimeLogController {

    private final TimeLogService timeLogService;

    @GetMapping(path = "page")
    public Mono selectPage(@RequestParam Map<String, Object> params) {
        return this.timeLogService.selectPage(params);
    }

    @GetMapping(path = "day")
    public Flux allUserDay(@RequestParam Map<String, Object> params) {
        return this.timeLogService.allUserDay(params);
    }

}
